/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controlador;

import Modelo.Listas;
import Vista.JFrameCooperativa;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

/**
 *
 * @author wualterh
 */
public class ControladorCooperativa implements ActionListener,KeyListener
{

    JFrameCooperativa formCooperativa;
    Listas LisC;
    
    public ControladorCooperativa(Listas Lis)
    {
      LisC=Lis;  
      formCooperativa=new JFrameCooperativa();  
      formCooperativa.agregarListener(this);
      formCooperativa.setVisible(true);
      
       //-------------------
        formCooperativa.getTxtPredt().addKeyListener(new KeyAdapter()
                
                   {        
                        public void keyTyped (KeyEvent e)
                          {     
                            PredtKeyTyped(e);  
                          }
                         
                       public void keyPressed(KeyEvent e) 
                       {
                         PredtKeyPressed(e);  
                       } 
        private void PredtKeyTyped(java.awt.event.KeyEvent evt)
                    
            {
              String Cadena;
                 Cadena=formCooperativa.getTxtPredt().getText();
                 if (Cadena.length()==10)
                 evt.consume();  
                    
             }

            private void PredtKeyPressed(KeyEvent e) 
    {
      
    } 
                         
  });

    }
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    @Override
    public void actionPerformed(ActionEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void keyTyped(KeyEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void keyPressed(KeyEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void keyReleased(KeyEvent e) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
